package com.zhaopin.gitlab;

import com.zhaopin.utils.FileUtil;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * 寻找差异文件
 */
public class Test2 {
    public static void main(String[] args) {
        String dicConfPath = "/Users/zhaopin/IdeaProjects/aggregator/rpc_position-recommend/groovy/src/main/groovy/com/zhaopin/script/data/config";
        String dicInitPath = "/Users/zhaopin/IdeaProjects/aggregator/rpc_position-recommend/groovy/src/main/groovy/com/zhaopin/script/data/init";
        List<File> dicConfPathList = FileUtil.getAllFiles(dicConfPath);
        List<File> dicInitPathList = FileUtil.getAllFiles(dicInitPath);

        List<String> confDicList = new ArrayList<>();
        for (File file : dicConfPathList) {
            String name = file.getName();
            String substring = name.substring(0, name.length() - ".tsv".length());
            confDicList.add(substring);
        }

        List<String> initDicList = new ArrayList<>();
        for (File file : dicInitPathList) {
            String name = file.getName();
            //G_InitData_allJobLevel.groovy
            String substring = name.substring("G_InitData_".length(), name.length() - ".groovy".length());
            initDicList.add(substring);
        }

        for (String s : confDicList) {
            if(!initDicList.contains(s)){
                System.out.println(s);
            }
        }


    }
}
